home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7436 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: magnus.acs.ohio-state.edu!news
  2. From: Xiaoyi Wu <xiaoyi@mozart.bme.ohio-state.edu>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Checking For Keyboard Input
  5. Date: Mon, 26 Feb 1996 12:13:21 -0500
  6. Organization: The Ohio State University
  7. Message-ID: <3131EA31.167E@mozart.bme.ohio-state.edu>
  8. References: <cerebus.34.000DD98A@voicenet.com> <4gqriq$qf2@maureen.teleport.com>
  9. NNTP-Posting-Host: mozart.bme.ohio-state.edu
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=gb2312
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; IRIX 5.3 IP22)
  14.  
  15. GHouck wrote:
  16. > cerebus@voicenet.com (aLEX) wrote:
  17. > >Hello fellow C programmers,
  18. > >        Is there anyway to check if keyboard input has been entered without
  19. > >actually stalling the excution of the code until the user presses a key.  I
  20. > >would really like to do this but I can't seem to find any way.  If you know of
  21. > >a way PLEASE email me or post it.  Thank you in advance.
  22. > >                                                    aLEX
  23. > >                                                    cerebus@voicenet.com
  24. > aLEX,
  25. > There is if you're using Borland on DOS/Windows: there is a function called
  26. >   kbhit()
  27. > If a key has been hit, it returns a non-zero value, else it returns zero.  If
  28. > one is available you can then get it with another call.
  29. > Yours, Geoff Houck
  30.  
  31. What about Unix?
  32. -- 
  33. Xiaoyi
  34.  
  35. /======================================================================\
  36. | Xiaoyi Wu        || If you can't convince them, confuse them.        |
  37. | 614-421-0934 (h) ||  xiaoyi@mozart.bme.ohio-state.edu                |
  38. | 614-292-1555 (o) ||  http://chopin.bme.ohio-state.edu/~xiaoyi/hi.html|
  39. \~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
  40.